from django.db import models

# Create your models here.
from mlh.utils.models import BaseModel
from users.models import User


class Educations(BaseModel):
    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户id", related_name="educations", null=True)
    # 外键字段会自动加上id，例：user_id
    u_education = models.CharField(max_length=32, verbose_name="学历", null=True)
    u_school = models.CharField(max_length=32, verbose_name="学校", null=True)
    study = models.CharField(max_length=32, verbose_name="专业", null=True)
    s_time = models.CharField(max_length=32, verbose_name="上学开始时间", null=True)
    e_time = models.CharField(max_length=32, verbose_name="毕业时间", null=True)
    u_skills = models.TextField(verbose_name="学校技能", null=True)
    desc = models.TextField(verbose_name="学校成就", null=True)

    class Meta:
        db_table = "tb_educations"
        verbose_name = "求学经历表"
        verbose_name_plural = verbose_name

    def __str__(self):
        return "%s:%s" % (self.user_id, self.id)
